<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改平台优惠券')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-coupon-edit" th:object="${nntPlatformCoupon}">
            <input name="numId" th:field="*{numId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="vcCouponName" th:field="*{vcCouponName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">发放总量：</label>
                <div class="col-sm-8">
                    <input name="numIssueTotal" th:field="*{numIssueTotal}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠形式：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('numDiscountType')}">
                        <input type="radio" th:id="${'numDiscountType_' + dict.dictCode}" name="numDiscountType" th:value="${dict.dictValue}" th:field="*{numDiscountType}">
                        <label th:for="${'numDiscountType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠金额：</label>
                <div class="col-sm-8">
                    <input name="numDiscountNumber" th:field="*{numDiscountNumber}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠%：</label>
                <div class="col-sm-8">
                    <input name="vcDiscountStr" th:field="*{vcDiscountStr}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">优惠门槛：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('numHasDiscountLimit')}">
                        <input type="radio" th:id="${'numHasDiscountLimit_' + dict.dictCode}" name="numHasDiscountLimit" th:value="${dict.dictValue}" th:field="*{numHasDiscountLimit}">
                        <label th:for="${'numHasDiscountLimit_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">限制价格：</label>
                <div class="col-sm-8">
                    <input name="numLimitPrice" th:field="*{numLimitPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">用户限制数量：</label>
                <div class="col-sm-8">
                    <input name="numUserLimitNum" th:field="*{numUserLimitNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效期类型：</label>
                <div class="col-sm-8">
                    <select name="numLimitDateType" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">有效期天数：</label>
                <div class="col-sm-8">
                    <input name="numAvailableDays" th:field="*{numAvailableDays}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">可用商品：</label>
                <div class="col-sm-8">
                    <input name="numAvailableGoods" th:field="*{numAvailableGoods}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">使用说明：</label>
                <div class="col-sm-8">
                    <input name="vcInstructions" th:field="*{vcInstructions}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">创建日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="datCreatDate" th:value="${#dates.format(nntPlatformCoupon.datCreatDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开始日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="datStartDate" th:value="${#dates.format(nntPlatformCoupon.datStartDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">结束日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="datEndDate" th:value="${#dates.format(nntPlatformCoupon.datEndDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">卡券状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('numDiscountState')}">
                        <input type="radio" th:id="${'numState_' + dict.dictCode}" name="numState" th:value="${dict.dictValue}" th:field="*{numState}">
                        <label th:for="${'numState_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "clothing/coupon";
        $("#form-coupon-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-coupon-edit').serialize());
            }
        }

        $("input[name='datCreatDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='datStartDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='datEndDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>